﻿#pragma once

#include "../MonsterObject.h"
#include "../MapObject.h"
#include "../../MirDatabase/MonsterInfo.h"
#include "../../../Shared/Enums.h"
#include "../PlayerObject.h"
#include <vector>
#include <any>
#include "../../../stringhelper.h"

using namespace Server::MirDatabase;
namespace S = ServerPackets;

namespace Server::MirObjects::Monsters
{
    class EvilMir : public MonsterObject
    {
    public:
        bool Sleeping = false;
    private:
        bool MassAttack = false;
    public:
        long long WakeUpTime = 0;
        MapObject *getTarget() const override;
        void setTarget(MapObject *value) override;

    private:
        bool _dragonlink = false;
    public:
        bool getDragonLink() const;
        void setDragonLink(bool value);

    protected:
        bool getCanAttack() const override;
        bool getCanMove() const override;

        EvilMir(MonsterInfo *info);

    public:
        void Turn(MirDirection dir) override;

        bool Walk(MirDirection dir) override;

        bool IsAttackTarget(MonsterObject *attacker) override;
        bool IsAttackTarget(PlayerObject *attacker) override;
    protected:
        bool InAttackRange() override;

        void ProcessRoam() override;

        void ProcessSearch() override;

        void ProcessAI() override;

        void CompleteAttack(std::vector<std::any> &data) override;
        void ProcessTarget() override;

        void Attack() override;

    public:
        int Attacked(MonsterObject *attacker, int damage, DefenceType type = DefenceType::ACAgility) override;

        int Attacked(PlayerObject *attacker, int damage, DefenceType type = DefenceType::ACAgility, bool damageWeapon = true) override;

        int Struck(int damage, DefenceType type = DefenceType::ACAgility) override;

        void ChangeHP(int amount) override;

        void Die() override;

        MirDirection SetDirection(MirDirection dir);
    };
}
